var express = require('express');
var router = express.Router();

const {getOrders,updateOrders,deletOrders,addOrders} = require("../service/ordersService")

//获取订单
router.get('/getOrders', async function (req, res, next) {

  const data = await getOrders(req.query)
    res.send(data)
});

//修改订单
router.post('/updateOrders', async function (req, res, next) {

  const data = await updateOrders(req.body)

    res.send(data)
});

//隐藏订单
// router.post('/deletOrders', async function (req, res, next) {
//   const data = await deletOrders(req.body)
//     res.send(data)
// });

router.post('/addOrders', async function (req, res, next) {
  const data = await addOrders(req.body)
    res.send(data)
});








module.exports = router;